<?php 
$this->set("title_for_layout", __("Tìm kiếm sản phẩm", true));
//debug($html->url("/"));    exit;
?>

<div class="content_above">
<div id="mcs3_container" class="main_content">
		<div class="customScrollBox">
			<div class="container">
				<div class="content">
					<h2 class="title"><?php __("Kết quả tìm kiếm cho '". $search_key ."'") ;?></h2>
					 <?php 
                     $cols = 3;
                     foreach($products as $key => $product): ?>
                     <?php
                      if($key % $cols == 0): ?>
                        <div class="products">
                        <ul>
                     <?php endif; ?>
                     	<li>
        					<a href="<?php echo $html->url(array('plugin' => 'products','controller' => 'products','action' => 'view',$product['Product']['alias']))  ;?>">
                                <?php echo $html->image('/files/products/'. $html->getThumbnailName($product['Product']['image']));?>        						
        					</a>
                            <span><?php echo $product['Product']['title']; ?></span>
                            <br />
                            <span><strong><?php echo $product['Product']['price']; ?></strong></span>
                            <a class="order" href="<?php echo $html->url(array('plugin' => 'products','controller' => 'products','action' => 'add_cart',$product['Product']['alias']))  ;?>"><?php echo __('Mua hàng');?></a>
        				</li>
                      <?php if($key % $cols == $cols -1):?>
                        </ul>
                        </div>
                     <?php endif; ?>
                     
                      <?php if($key % $cols != $cols -1 && $key == count($products)-1 ): ?>
                        </ul>
                        </div>
                     <?php endif; ?>                     
                     <?php endforeach; ?>
                    <?php if (count($products) > 9): ?>					
					<div style="clear:both"></div>
					<?php echo $this->element('pagination/pagination', array('model' => 'Product'));?>
                    <?php endif; ?>
                    <?php if(count($products) == 0) : ?>
                    <p><?php echo __('Không tìm thấy kết quả nào.') ?></p>
                    <?php endif;?>
				</div>
				</div>
			</div>
			<div class="dragger_container">
				<div class="dragger"></div>
			</div>
		</div>

<div class="right_content">
	<h1 class="title"><?php echo __('Sản phẩm mới');?><h1>
	<div class="product-list">
	   <?php echo $this->element('new_products');?>
	</div>
</div>
</div>
<?php
echo $this->Html->script('jquery-ui.min.js', array('type' => 'text/javascript'));	
echo $this->Html->script('jquery.mousewheel.min.js', array('type' => 'text/javascript'));	
echo $this->Html->script('jquery.easing.1.3.js', array('type' => 'text/javascript'));	
echo $this->Html->script('news.js', array('type' => 'text/javascript'));
echo $this->Html->script('jquery.mCustomScrollbar.js', array('type' => 'text/javascript')); ?>